<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>BeerAir</title>
	<link href="./css/bootstrap.css" rel="stylesheet" type="text/css"/> 
    <link href="./css/styles.css" rel="stylesheet" type="text/css"/> 
    <script type="text/javascript" src="./resources/myjs.js"/>
   	<h:outputScript library="js" name="myjs.js"/>
</h:head>
<h:body onload="showMessage('#{homeView.error}')">
	<h:graphicImage id="airplane" value="./images/airplane.jpg"/>
	<div id="header"></div>
	<div id="container" >
		<div id="navbar">
			<h:form>  
				<p:menubar >  
					<p:menuitem value="Flights"/>  
					<p:menuitem value="Offers"/>  
					<p:menuitem value="My Booking"/>  
					<p:menuitem value="About"/>  
     				<p:menuitem value="FAQ"/>  
    			    <f:facet name="options">  
     			       <p:inputText style="margin-right:10px"/>  
     			       <p:commandButton type="button" value="Search"/>  
     			   </f:facet>  
   				</p:menubar>  
			</h:form>  	
		</div>
		<div id="content">
			<h:form class="mainform">
			<h1>Flight</h1><br/><br/>
				<table width="90%">
  				<tr>
  					<td class="airport">
  						<label>Departure Airport</label>
   				 		<h:selectOneMenu value="#{homeView.depAirport}">
   				 		<f:selectItems value="#{homeView.getAllAirports()}" var="airport"
   				 						itemLabel="#{airport.getCity()}" itemValue="#{airport.getIcaoCode()}" />
						</h:selectOneMenu>
   					</td>
   					<td class="airport">
  						<label>Arrival Airport</label>
   					 	<h:selectOneMenu value="#{homeView.arrAirport}">
   					 	<f:selectItems value="#{homeView.getAllAirports()}" var="airport"
   				 						itemLabel="#{airport.getCity()}" itemValue="#{airport.getIcaoCode()}"/> 

						</h:selectOneMenu>
   					</td>
   					<td>
  						<h:selectBooleanCheckbox id="oneway" value="#{homeView.oneWay}"/>
  						<h:outputLabel value="One-Way" for="oneway" />
  					</td>
  				</tr>
				<tr>
					<td>
						<label>Departure Date</label>
						<p:calendar value="#{homeView.depDate}"/>
					</td>
					<td >
						<label>Return Date</label>
   						<p:calendar id="returndate" value="#{homeView.retDate}"/>   
					</td>
				</tr>
				<tr>
					<td>
						<label>Adults</label>
   					 	<h:selectOneMenu class="people" value="#{homeView.adult}">
  							<f:selectItem itemValue="1"/>
        					<f:selectItem itemValue="2"/>
       		 				<f:selectItem itemValue="3"/>
        					<f:selectItem itemValue="4"/>
        					<f:selectItem itemValue="5"/>
						</h:selectOneMenu>
					</td>
					<td>
						<label>Child</label>
   						<h:selectOneMenu class="people" value="#{homeView.child}">
   					 		<f:selectItem itemLabel="0"/>
  							<f:selectItem itemValue="1"/>
        					<f:selectItem itemValue="2"/>
    	    				<f:selectItem itemValue="3"/>
        					<f:selectItem itemValue="4"/>
        					<f:selectItem itemValue="5"/>
						</h:selectOneMenu>
					</td>
					<td>
						<label>Infant</label>
   						<h:selectOneMenu class="people" value="#{homeView.infant}">
   					 		<f:selectItem itemLabel="0"/>
  							<f:selectItem itemValue="1"/>
        					<f:selectItem itemValue="2"/>
        					<f:selectItem itemValue="3"/>
        					<f:selectItem itemValue="4"/>
    	    				<f:selectItem itemValue="5"/>
						</h:selectOneMenu>
					</td>	
				</tr>
  			</table><br/>
			<h:commandButton class="submit" value="Book Now" action="#{homeView.showTimetable}"/><br/>
		</h:form>
		</div>
		<div id="aside"></div>
	</div>
	<div id="footer"></div>
</h:body>
</html>